function FullScreen() {
	var that = this;

	var div;

	var background;
	var width;
	var height;
	var position;
	var zindex;
	var top;
	var left;
	var margintop;
	var marginleft;
	var marginright;
	var marginbottom;

	//全屏
	this.FullScreen = function(divId) {

		if (!document.getElementById("fullScreen_closeBar")) {
			var backDiv = $('<div id="fullScreen_backDiv" style="display: none; background: gray; width: 100%; height: 100%; position: fixed; z-index: 197; top: 0px; left: 0px; overflow-x: hidden; overflow-y: hidden;"></div>');
			var tempDiv = $('<div id="fullScreen_closeBar" style="display: none; background: gray; width: 100%; height: 27px; position: fixed; z-index: 198; top: 0px; left: 0px; overflow-x: hidden; overflow-y: hidden;"><input style="float:right;margin: 0px; padding: 5px 10px; border: 0px; background-color: #F7941D; color: white; font-size: 14px; cursor: default;" type="button" id="closeFullScreen" value="关闭" /></div>');
			$(document.body).append(backDiv);
			$(document.body).append(tempDiv);
		}
		
		$("#closeFullScreen").click(function() {
			that.CloseFullScreen();
		});

		div = $("#" + divId);

		background = div.css("background");

		width = div.css("width");
		height = div.css("height");
		position = div.css("position");
		zindex = div.css("z-index");
		top = div.css("top");
		left = div.css("left");

		margintop = div.css("margin-top");
		marginleft = div.css("margin-left");
		marginright = div.css("margin-right");
		marginbottom = div.css("margin-bottom");

		$("#fullScreen_backDiv").show(500);
		$("#fullScreen_closeBar").show(700);
		div.hide();
		div.css("background", "#FFFFFF");
		div.css("width",  "100%");
		div.css("height",($(window).height()-27)+"px");
		div.css("position", "fixed");
		div.css("z-index", "199");
		div.css("top", "27px");
		div.css("left", "0px");
		div.css("margin-top", "0px");
		div.css("margin-left", "0px");
		div.css("margin-right", "0px");
		div.css("margin-bottom", "0px");
		div.show(1000);
	}

	//关闭全屏
	this.CloseFullScreen = function() {
		
		div.hide();
		div.css("background", background);
		div.css("width", width);
		div.css("height", height);
		div.css("position", position);
		div.css("z-index", zindex);
		div.css("top", top);
		div.css("left", left);
		div.css("margin-top", margintop);
		div.css("margin-left", marginleft);
		div.css("margin-right", marginright);
		div.css("margin-bottom", marginbottom);

		$("#fullScreen_closeBar").hide(500);
		$("#fullScreen_backDiv").hide(500);

		div.show(500);
	}
}

var fullScreen = new FullScreen();